' //This function is a crude string -> number algorithm//
' //It can be used to make a checksum of the registration information//
Declare Function MakeAKey Lib "GBLIB2.EXE" (ByVal AString As String) As Long
' //These two functions must NOT be used in development mode//
' //on this project, because they are designed to//
' //modify REGMAX.EXE file directly, and until it has been//
' //compiled, there is no REGMAX.EXE to modify!
Declare Function WriteRegData Lib "GBLIB2.EXE" (ByVal sz_Name As String, ByVal sz_Org As String, ByVal sz_EXEPath As String, ByVal MyPhrase As String) As Integer
'**** Line below changed 02/01/95 [GB] ****
Declare Function ReadRegData Lib "GBLIB2.EXE" (ByVal sz_EXEPath As String, ByVal sz_Name As String, ByVal sz_Org As String, ByVal YMD As String, NameLen As Integer, OrgLen As Integer) As Integer
' //These Subs simply show information//
Declare Sub ShowWinDir Lib "GBLIB2.EXE" ()
Declare Sub ShowSysDir Lib "GBLIB2.EXE" ()
' //Registration variables//
Global USERNAME As String
Global USERORG As String
Global BRANDDATE As String
' //Data constant//
Global Const MONTHSTRING = "JanFebMarAprMayJunJulAugSepOctNovDec"
' //WIN31 API Function to bar accidents in development mode!//
Declare Function FindWindow Lib "User" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Sub DevMsg ()
' /* Modified 31/12/94 [GB] */
' /* Created 31/12/94 [GB] */
' //This message is shown if ISVBRUNNING returns true//
Dim msg As String
msg = "You are working in Development Mode" & Chr$(10) & Chr$(10)
msg = msg & "I cannot therefore read or write data" & Chr$(10)
msg = msg & "to or from REGMAX.EXE," & Chr$(10)
msg = msg & "because you havn't compiled it yet!" & Chr$(10)
msg = msg & "Compile REGMAX.EXE, and run it outside" & Chr$(10)
msg = msg & "of the Visual Basic IDE entirely."
MsgBox msg, 48, "REGMAX - Get / PutDataIntoEXE"
End Sub
Sub GetDataFromEXE ()
' /* Modified 02/01/95 [GB] */
' /* Modified 30/12/94 [GB] */
' /* Created 30/12/94 [GB] */
' //Quit out in development mode//
If ISVBRUNNING() <> 0 Then
DevMsg
Exit Sub
End If
Dim i_RetValue As Integer
Dim sz_EXEPath As String
Dim NameLen As Integer
Dim OrgLen As Integer
Dim TUserName As String
Dim TUserOrg As String
Dim YMD As String
' //Get the full path and filename of this application//
sz_EXEPath = App.Path
If Right$(sz_EXEPath, 1) <> "\" Then sz_EXEPath = sz_EXEPath & "\"
sz_EXEPath = sz_EXEPath & App.EXEName & ".EXE"
' //You MUST initialise the strings to this length or VB cannot//
' //cope with passing strings to/from the GBLIB2 API//